# 基础语法快速入门
# print(1)
# print(1, 2)
# print(1 + 2)
# print("1" + "5")

# str = "cxs-test"
#
# print(str[0:1])
# print(str[0:])
# print(str[0:-2])
# print(str[0:0])
# print(str * 2)
# print("aaa\nbbb")
# print(r"aaa\nbbb")

# s = input("请输入:\n")
# str = "haha"
# print(s.__eq__(str))

# type = "cat"
# if type.__eq__("dog"):
#     print("aaa")
# elif type.__eq__("cat"):
#     print("bbb")

# print("aaa")
# print("bbb", end="")  # 不换行

# import sys
#
# print("aaa")
# print("-------测试循环和导入命令-----")
# for i in sys.argv:
#     print(i)
# print("python获取到环境变量为:", sys.path)
#
# from sys import path
#
# print(path)

# 数据类型
# counter = 100  # 整型变量
# miles = 1000.0  # 浮点型变量
# name = "runoob"  # 字符串
#
# print(counter)
# print(miles)
# print(name)

# a = b = c = 1
# print(a, b, c)
#
# a, b, c = 1, 2, "runoob"
# print(a, b, c)

# a = 1
# b = "1"
# c = True
# d = False

# print(type(a))
# print(type(b))
# print(type(c))
# print(type(d))

# print(isinstance(a, int))
'''
type()不会认为子类是一种父类类型。
isinstance()会认为子类是一种父类类型。
'''

# class A:
#     a = 10
#
#
# def testA():
#     print(a)
#
#
# class B(A):
#     b = 20
#
#
# def testB():
#     print(b)
#
#
# newA = A()
# newB = B()
# print(isinstance(newA, A))
# print(isinstance(newB, A))
#
# print(type(newA) == A)
# print(type(newB) == A)

# vara = 1
# varb = 1
#
# del vara
# print(vara)
# print(varb)

# print(3 ** 5)
#
# print(3 / 5)  # 浮点数
# print(3 // 5)  # 整数

# listA = [1, 2, 3, 4, 5]
# print(listA[0: 2])  # [0,2)
# print(listA[0:])
# print(listA * 2)
#
# listA[0] = 9
# listA[1:2] = [88, 99]
# print(listA)
# listA[3:4] = []
# print(listA)

# listA.append("a")
# print(listA)
#
# i = 0
# while True:
#     listA.append("s")
#     i += 1
#     if i >= 3:
#         break
#
# print(listA)
# listA.pop(1)  # 下表索引
# print(listA)

# listA = [1, 2, 3, 4, 5]
#
# print(listA[-1::-1])
# print(listA[999])  # 会越界

# yz = ("a", "b", 3, 4, "c")  # 元祖中的元素不能修改
# print(yz[0:3])
# print(yz[0])
#
# newYz = (1,)
# print(newYz)
#
# yz_yz = newYz + yz
# print(yz_yz)

# mySet = {"qwqq", "er", "as", "df", "df"}  # 去重 自动排序 无序的
# mySet2 = set("zasdal:klas;dkadadasdqwdasdasdadz")  # 可以进行去重输出
# print(mySet)
# print(mySet2)
#
# mySet.add("sss")
# print(mySet)
# mySet.remove("as")
# print(mySet)


# while True:
#     pop = mySet.pop()
#     print(pop)
#     if mySet.__len__() <= 0:
#         break
# print("谈完了")


# def exists(mySet):
#     if mySet.__contains__("df"):
#         print("true")
#
#
# exists(mySet)

# a = {1, 2, 3, 4, 5}
# b = {1, 2, 3, 4}
# print(a - b)
# print(a | b)
# print(a & b)
# print(a ^ b)
# list 用[] 元祖用() set用{} 字典也是{}  python中一个空行 也有意义，格式非常重要
# 字典 类似java中的Map
# 列表是有序集合，字典是无序集合。字典当中的元素是通过键来存取的，而不是通过偏移存取

# dict = {}
# dict["k1"] = "v1"
# dict["k2"] = "v2"
#
# dict2 = {"name": "cxs", "age": 18}
# print(dict)
# print(dict2)
# print(dict2["age"])
# print(dict2.keys())
# print(dict2.values())
#
# if "name" in dict2.keys():
#     dict2.clear()
#     print(dict2)

# i = int("3")
# print(i)

# str = "asdadasd"
# tuple1 = tuple(str)
# print(tuple1)
#
# l = list(str)
# print(l)
#
# s = set(str)
# print(s)

# i = 1
# a = 2
# b = 3
# c = 4
# if (i >= 0 and a <= 1) or (b < 3 or c >= 4):
#     print("i >= 0 && a <=3")
# d = True
# print(not d)


# list = [1, 2, 3, 4, 5]
# print(1 not in list)

# a = 10
# b = 10
#
# print(a == b)
# print(id(a) == id(b))
# print(a is b)

# is 用于判断两个变量引用对象是否为同一个， == 用于判断引用变量的值是否相等
# s1 = "aaa"
# s2 = "aaa"
# print(s1 == s2)

# a = [1, 3]
# b = [1, 3]
# print(a == b)
# print(a is b)

# import math
# import random
#
# a = -10
# print(abs(a))
# b = 10.2
#
# c = [1, 3, 4, 3, 2, 45]
#
# print(math.ceil(b))
# print(random.random())
# print(random.choice(c))
# print(c)
# random.shuffle(c)
# print(c)

# import random
#
# code = ""
# for _ in range(6):
#     digit = random.randrange(0, 10)
#     code += str(digit)
# print(code)
#
# s1 = "nihao haha"
# print(s1[0:5] + " heihei")

# print("你好 %s 今年多大了 %d" % ("小黑", 10))
# name = "zhangsan"
# print(f"我叫{name}")

# x = 1
# print(f'{x+1=}')
